﻿using Microsoft.SharePoint;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sobiens.Connector.Admin.DAL
{
    class ConfigurationList : BaseList
    {
        internal const String NAME = "Configuration";
        internal static class FIELDS
        {
            internal const string TITLE = "Title";
            internal const string DESCRIPTION = "Description";
            internal const string DATA = "Data";
        }

        public ConfigurationList():base(NAME)
        { }

        internal void UpdateItem(Guid id, String data) {
            SPListItem item = _list.GetItemByUniqueId(id);
            UpdateItem(item, data);
        }

        private void UpdateItem(SPListItem item, String data)
        {
            item[ConfigurationList.FIELDS.DATA] = data;
            item.Update();
        }
    }   
}
